<?php
//ob_start();
session_start();
require_once "classUser.php";
$u = new user;
$loi = array();
if (isset($_POST['btnBookOnline'])==true) {
	//if ($_POST['cap']!=$_SESSION['captcha_code']){
		//	$loicaptcha = "Ban nhập sai ma so trong hinh";
    //}else {
   
	$thanhcong = $u->DangKyBookOnline($loi);
	if ($thanhcong==true) header('location: index.php?p=book_success'); 
	
	//}
}
?>

<script>
$(document).ready(function(){
	$(".text").corner("left");
});
</script>
<style type="text/css">
<!--
#bookonline {
	height: auto;
	width: 700px;
}
#path  {
	color:#FFFFFF;
	padding-top:13px;
	padding-bottom:5px;
	font-weight:bold;
	background-image: url(image/label_long.png);
	background-repeat: no-repeat;
	height: 33px;
	width: 690px;
	padding-left: 10px;
	text-align: left;
}
#path  a {
	text-decoration:none;
	color:#FFFFFF;
}
#path  a:hover {
	text-decoration:none;
	color:#FFFFFF;
	border-bottom-width: 1px;
	border-bottom-style: dotted;
	border-bottom-color: #FFFFFF;
}
#bookonline #form p {
	margin: 0px;
}
#bookonline   #form   #tour, #soluong, #ten,  #tel, #email, #cap, #diachi    {
	font-weight: bold;
	color: #004000;
	background-color: #C1FFC1;
	width: 300px;
	height: 30px;
	border: 2px solid #008000;
}

#bookonline #form #noidung {
	font-weight: bold;
	color: #004000;
	background-color: #C1FFC1;
	width: 300px;
	height: 200px;
	border: 2px solid #008000;
}
#bookonline #form #btnBookOnline {
	margin-left: 100px;
	color: #FFFFFF;
	background-color: #800000;
	width: 100px;
	border: 4px double #C1FFC1;
	margin-top: 5px;
	font-weight: bold;
}
#bookonline #form #cap {
	font-weight: bold;
	color: #004000;
	background-color: #C1FFC1;
	width: 300px;
	height: 30px;
	border: 2px solid #008000;
	margin-left: 100px;
	text-align: center;
}
.text {
	font-weight: bold;
	color: #FFFFFF;
	background-color: #008000;
	display: inline;
	clear: right;
	float: left;
	height: 28px;
	width: 100px;
	text-align: center;
	padding-top: 2px;
}
.td {
	height: 32px;
	padding-top: 4px;
}
.error    {
	color: #A40000;
}
.style1 {
	color: #FF0000;
	font-weight: bold;
}
-->
</style>
<div id="bookonline">
<div id="path"> <a href="index.php">Home</a> &nbsp; <img src="images/icon_arrow.png" alt="&gt;">Book tour online</div>

<div id="form">
  <form name="form1" method="post" action="">
  	<table width="100%" border="0" cellspacing="0" cellpadding="0">  
  <tr>
    <td>&nbsp;</td>
    <td width="88%" class="td"><p class="text">Tour đã đặt
      </p>
 
        <input type="text" name="tour" id="tour" value="<?=$_SESSION['TenTour'];?>" disabled="disabled">      </td>
        
  </tr>
  
  <tr>
    <td>&nbsp;</td>
    <td width="88%" class="td"><p class="text">Số lượng</p>
 
        <input type="text" name="soluong" id="soluong" value="<?=$_SESSION['SoLuong'];?>" disabled="disabled">	</td>
  </tr>
  <tr>
    <td width="12%">&nbsp;</td>
    <td width="88%" class="td"><p class="text">Tên bạn
      </p>
 
        <input type="text" name="ten" id="ten" value="<?=$ten?>">
        <span class="error">
        <?=$loi['ten']?>
        </span></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td class="td"><p class="text">Email
      </p>

        <input type="text" name="email" id="email" value="<?=$email?>">
        <span class="error"> <?=$loi['email']?> </span>        </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td class="td"><p class="text">Số điện thoại
      </p>

        <input type="text" name="tel" id="tel" value="<?=$phone?>">      
        <span class="error"> <?=$loi['phone']?> </span>        </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td class="td"><p class="text">Địa chỉ
      </p>

        <input type="text" name="diachi" id="diachi" value="<?=$diachi?>">      
        <span class="error"> <?=$loi['diachi']?> </span>        </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td class="td"><p class="text">Nội dung
      </p>
      
        <textarea name="noidung" id="noidung" value="<?=$noidung?>" cols="45" rows="5"></textarea>        
        <span class="error"> <?=$loi['noidung']?> </span>        </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td class="td">
	  <p class="error"><?php echo $loi['captcha'];?>
	    <br />
	    </p>
	  <p class="text">Mã an toàn</p>
	  <p><img src="capcha_image_2.php" class="captcha" /> 
	    <br/> 
	    <input name="cap" type="text" class="txt" id="cap"/>    
	    </p></td>
  </tr>
		<?php 
			$_SESSION['ten'] = $_POST['ten'];
			$_SESSION['email'] = $_POST['email'];
			$_SESSION['diachi'] = $_POST['diachi'];
			$_SESSION['phone'] = $_POST['tel'];
        ?>
  <tr>
    <td>&nbsp;</td>
    <td><input type="submit" name="btnBookOnline" id="btnBookOnline" value="Đặt tour"></td>
  </tr>
</table>

  </form>
  

</div><!--END DIV FORM-->
</div><!--END DIV LIEN HE-->